﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;

using Newtonsoft.Json;

namespace FiberVisible
{
    /// <summary>
    /// OpenSEES
    /// </summary>
    public class OpenSEESInfomation
    {
        /// <summary>
        /// OpenSEES模型信息
        /// </summary>
        public OpenSEESModel StructuralAnalysisModel { set; get; }

        /// <summary>
        /// 反序列化
        /// </summary>
        /// <param name="filePath"></param>
        /// <returns></returns>
        public static OpenSEESInfomation FromJson(string filePath)
        {
            var str = File.ReadAllText(filePath);
            return JsonConvert.DeserializeObject<OpenSEESInfomation>(str);
        }
    }

    /// <summary>
    /// OpenSEES 模型
    /// </summary>
    public class OpenSEESModel
    {
        /// <summary>
        /// 未知
        /// </summary>
        public string BIM { set; get; }

        /// <summary>
        /// 模型描述
        /// </summary>
        public string description { set; get; }

        /// <summary>
        /// 模型特性
        /// </summary>
        public OpenSEESProperties properties { set; get; }
    }

    /// <summary>
    /// 属性
    /// </summary>
    public class OpenSEESProperties
    {
        /// <summary>
        /// 材料信息
        /// </summary>
        public List<OpenSEESMaterial> uniaxialMaterials { set; get; }
    }

    /// <summary>
    /// 材料信息
    /// </summary>
    public class OpenSEESMaterial
    {
        /// <summary>
        /// 材料名称
        /// </summary>
        public string name { set; get; }

        /// <summary>
        /// 材料类型
        /// </summary>
        public string type { set; get; }
    }
}
